(function($){
	 $.fn.treegrid.defaults.loader =  function(_ab3, _ab4, _ab5) {
		var opts = $(this).treegrid("options");
		if (!opts.url) {
			return false;
		}
		$.ajax({
			type: opts.method,
			url: opts.url,
			data: _ab3,
			dataType: "json",
			success: function(data) {
				if(data && data.rows && data.rows.length > 0) {
					for(var i = 0; i < data.rows.length; i++) {
						var row = data.rows[i],boo=false,isHasChild=false;
						for(var j = 0; j < data.rows.length; j++){
							var row2 = data.rows[j];
							if(row2[opts.idField] == row._parentId){
								boo = true;
							}
							if(row[opts.idField] == row2._parentId){
								isHasChild = true;
							}
						}
						if(!boo){
							data.rows[i]._parentId = undefined;
						}
						if(!row.state && isHasChild){
							data.rows[i].state = "closed";
						}
					}
				}
				_ab4(data);
			},
			error: function() {
				_ab5.apply(this, arguments);
			}
		});
	}
})(jQuery)